<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ .Title }}</title>
    <link rel="icon" type="image/x-icon" href="/assets/static/img/favicons/favicon.ico">
    <link rel="manifest" href="/assets/static/site.webmanifest"/>

    <!-- Tailwind CSS -->
    <script src="/assets/js/tailwind.js"></script>

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="/assets/css/lexend-mega.css" rel="stylesheet">

    <!-- Tailwind Configuration -->
    <script>
        tailwind.config = {
            darkMode: 'class',
            theme: {
                extend: {
                    // theme extensions here
                },
                fontFamily: {
                    sans: ['Lexend Deca', 'sans-serif'],
                    serif: ['Lexend Deca', 'serif'],
                },
            },
        }
    </script>
</head>

<body class="min-h-screen flex flex-col bg-gray-100 dark:bg-gray-900">

    <noscript>
        <h1>You need to enable JavaScript to run this webapp.
    </noscript>

    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="crossorigin="anonymous"></script>

    <!-- Navbar -->
    {{ template "navbar_default" . }}

    <!-- Main content -->
    <main id="main" class="flex-grow bg-gray-100 dark:bg-gray-900">
        {{ embed }}
    </main>

    <!-- Modal container -->
    <div id="modalContainer" class="relative z-50"></div>

    <!-- Loading overlay -->
    <div id="loadingOverlay" class="hidden fixed inset-0 bg-black/75 flex justify-center items-center z-50">
        <div class="animate-spin rounded-full h-12 w-12 border-4 border-white border-t-transparent"></div>
    </div>

    <!-- Footer -->
    <footer class="bg-white dark:bg-gray-800 shadow-lg">
        <div class="container mx-auto px-4 py-6">
            <div class="text-center">
                <h3 class="text-lg font-semibold text-gray-800 dark:text-white">
                    CloudLink Omega
                </h3>
                <p class="mt-2 text-sm text-gray-600 dark:text-gray-300">
                    An open source WebRTC-powered multiplayer network.
                </p>
                <p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
                    Copyright © 2025 Mike J. Renaker "MikeDEV". All rights reserved.
                </p>
                <p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
                    <b>You are currently using {{ .ServerName }}.</b>
                </p>
                <p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
                    <a class="underline" href="/terms">Terms of Service & Privacy Policy</a>
                </p>
                <div class="mt-3 flex items-center justify-center space-x-2">
                    <span class="text-sm text-gray-600 dark:text-gray-300">Powered by</span>
                    <a href="https://go.dev/"
                        class="text-sm hover:opacity-80 transition-opacity">
                        <img src="/assets/static/img/golang.png" alt='A blue gopher next to a blue "Go" word' class="h-6 inline-block" />
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <!-- Theme toggle -->
    <script src="/assets/js/color-modes.js"></script>
</body>

</html>